package com.jt.assistant.adapter

import android.annotation.SuppressLint
import android.view.View
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jt.assistant.R
import com.jt.assistant.bean.SkuBean

class SkuPicAdapter(mData: MutableList<SkuBean>) :
    BaseQuickAdapter<SkuBean, BaseViewHolder>(
        R.layout.item_carinfo_list, mData
    ) {

    init {
        addChildClickViewIds(R.id.bt_upload)
    }

    @SuppressLint("SetTextI18n")
    override fun convert(holder: BaseViewHolder, item: SkuBean) {
        val tvSku = holder.getView<View>(R.id.tv_sku) as TextView
        val tvSkuPic = holder.getView<View>(R.id.tv_sku_pic) as TextView
        tvSku.text = item.sku
        tvSkuPic.text = if (item.picNum == 0) "未上传图片" else "已上传${item.picNum}张"
    }
}